<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../common/commonJS.jsp" %>
<%@ include file="../common/commonLabel.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>机台排产信息列表</title>
</head>
<script type="text/javascript">

function doIns(){
	if(confirm("确认保存信息?")){
		document.all.operate.value = "insinfo";
		document.forms[0].submit();
	}
}
function doback(){
	document.forms[0].action = "<%=path %>/MachineOrderList.action";
	document.forms[0].submit();
}
function doCheck(obj,tid){
	if(obj.checked){
		obj.value='y'
	}else{
		obj.value='n'
	}
	comdwr.task_Check(obj.value,tid,function(bo){
		if(bo){
		}
	})
}
//导出排产单
function doOrderprint(){
	var oldaction = document.forms[0].action;
	document.forms[0].action = "<%=path %>/docs/ys_machineTaskOrder/order_print.jsp";
	document.forms[0].submit();
	document.forms[0].action = oldaction;
}
//导出任务单
function doTaskprint(){
	var oldaction = document.forms[0].action;
	document.forms[0].action = "<%=path %>/docs/ys_machineTaskOrder/task_printnew.jsp";
	document.forms[0].submit();
	document.forms[0].action = oldaction;
}
</script>
<body>
<form action="<%=path %>/SaveOrders.action" method="post" >
<table width="90%" border="0" cellpadding="0" cellspacing="0" >
  <tr>
     <td>
     <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" class="MainBody">
		<tr>
    		<td width="760" class="MainBody_title"><hello:forValue type="title" /></td>
    		<td></td>
		</tr>
      <tr>
        <td valign="top" colspan="2">
        <table border="0" cellspacing="0" cellpadding="0" style="margin-top: 10px;margin-bottom: 10px;width:90%">
			<tr>
				<td align="right" >机台名称：${machineinfo.machinename }&nbsp;&nbsp;&nbsp;&nbsp;机台编号：${machineinfo.machineid }&nbsp;&nbsp;&nbsp;&nbsp;
				<%--**************隐藏域信息************************--%>
				<input name="machineid" type="hidden" value="${machineinfo.machineid }"/>
				<input name="machinename" type="hidden" value="${machineinfo.machinename }"/>
				<input name="operate" type="hidden" value=""/>
				<%--*****************************************************--%>
				</td>
				<td align="right" ><input type="button" value="保存顺序" class="btn" onclick="doIns()"/>&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="button" value="导出排产单" class="btn" style="width: 80px" onclick="doOrderprint()"/>&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="button" value="导出生产单" class="btn" style="width: 80px" onclick="doTaskprint()"/>&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="button" value="返 回" class="btn" onclick="doback()"/>
				</td>
			</tr>
		</table>
        <table border="0" cellpadding="0" cellspacing="0"  class="MainBody_table">
           <tr>
				<th width="5%" nowrap="nowrap">操作</th>
				<th width="7%" nowrap="nowrap">排序</th>
				<th width="10%" nowrap="nowrap">订单编号</th>
				<th width="10%" nowrap="nowrap">订单名称</th>
				<th width="10%" nowrap="nowrap">生产单编号</th>
				<th width="10%" nowrap="nowrap">生产单名称</th>
				<th width="7%" nowrap="nowrap">下单日期</th>
				<th width="12%" nowrap="nowrap">物料名称&规格</th>
				<th width="7%" nowrap="nowrap">印刷尺寸</th>
				<th width="8%" nowrap="nowrap">成品数量</th>
				<th width="8%" nowrap="nowrap">加放数量</th>
				<th width="8%" nowrap="nowrap">物料数量</th>
				<th width="6%" nowrap="nowrap">负责人</th>
			</tr>
			<c:forEach items="${listinfo}" varStatus="status" var="rows">
			<tr>
				<td nowrap="nowrap"><input type="checkbox" name="checkflag" value="${rows.checkflag }" onclick="doCheck(this,'${rows.taskid }')" <c:if test="${rows.checkflag=='y'}">checked</c:if>></td>
				<td nowrap="nowrap"><input type="text" value="${status.index+1 }<%-- ${rows.orders==null||rows.orders==''?status.index+1:rows.orders } --%>" name="orders" maxlength="3" style="width: 98%;text-align: center;"/></td>
				<td nowrap="nowrap">${rows.orderid }</td>
				<td nowrap="nowrap">${rows.name }</td>
				<td nowrap="nowrap">${rows.taskid }<input name="taskid" type="hidden" value="${rows.taskid }"/></td>
				<td nowrap="nowrap">${rows.taskName }</td>
				<td nowrap="nowrap">${rows.ordertime }</td>
				<td nowrap="nowrap">${rows.goodsname } & ${rows.standard }</td>
				<td nowrap="nowrap">${rows.printSize }</td>
				<td nowrap="nowrap">${rows.amount }</td>
				<td nowrap="nowrap">${rows.addAmount }</td>
				<td nowrap="nowrap">${rows.subPaper }</td>
				<td nowrap="nowrap"><select name="createuser" style="width: 98%">
                <c:forEach var="person" varStatus="status" items="${personlist}">
				<option value="${person.personname }" <c:if test="${rows.createuser==person.personname}">selected</c:if>>${person.personname }</option>
				</c:forEach></select></td>
			</tr>
			</c:forEach>
			<c:if test="${empty listinfo}">
			<tr>
				<td colspan="13" align="center">暂时没有您可以浏览的数据</td>
			</tr>
			</c:if>
			
          </table>
          </td>
      </tr>
    </table></td>
  </tr>
</table>
</form>
</body>
</html>